package top.huhuiyu.springboot2.study.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author 胡辉煜
 */
@Slf4j
@Aspect
@Component
@Order(2000)
public class AroundAop implements BaseControllerAop {

  @Around("controller()")
  public Object around(ProceedingJoinPoint point) throws Throwable {
    log.debug("进入环绕切面：{}", point.getSignature());
    Object result = point.proceed();
    log.debug("环绕切面返回值：{}", result);
    log.debug("退出环绕切面");
    return result;
  }

}
